#ifndef CFDPOST2DCURVEWIDGET_H
#define CFDPOST2DCURVEWIDGET_H

#include <QtCharts/QChartView>
#include "CFDPostUIAPI.h"
#include <QtCharts/QChart>
#include <QValueAxis>
#include <QLineSeries>

QT_CHARTS_USE_NAMESPACE

class CFDPostUIAPI CFDPost2DCurveWidget : public QChartView {
    Q_OBJECT
  public:
    CFDPost2DCurveWidget(QWidget *parent = 0);
    // 设置X、Y坐标标题
    void setAxisLabel(QString labelX, QString labelY);
    // 添加渲染的数据
    void addChartData(QVector<QPointF> &data);
    // 设置视图标题
    void setTitle(QString str);

  private:
    QChart *m_chart;
    QValueAxis *m_axisX;
    QValueAxis *m_axisY;
    QLineSeries *series;

  private:
    // 初始化视图
    void initChart();
    // 初始化坐标轴
    void initAxis();
};

#endif // CFDPOST2DCURVEWIDGET_H
